/* eslint-disable @typescript-eslint/no-unused-vars */
import { useDigital } from "@/hooks"
import { handleTotalNumber } from "@/utils/util"

export interface RootObject {
	reportDate: number
	staticsDate: string
	effecactiveMemberNum: number
	activeMemberNum: number
	validBetAmount: number
	platformNetAmount: number
	platformIncomeAmount: number
}

const dataComparisonReportColumns = () => {
	const { renderColor } = useDigital()
	const dataComparisonReport_effecactiveMemberNum = {
		title: "report.addedEffectiveMembership",
		width: 120,
		sorter: (a: RootObject, b: RootObject) => a.effecactiveMemberNum - b.effecactiveMemberNum
	}
	const dataComparisonReport_activeMemberNum = {
		title: "report.activeMember",
		width: 120,
		sorter: (a: RootObject, b: RootObject) => a.activeMemberNum - b.activeMemberNum
	}
	const dataComparisonReport_validBetAmount = {
		title: "report.effectiveBet",
		width: 120,
		sorter: (a: RootObject, b: RootObject) => a.validBetAmount - b.validBetAmount,
		render: (v: number) => (v ? <p className="text-link">{handleTotalNumber("$", "10k", v)}</p> : "-")
	}
	const dataComparisonReport_platformNetAmount = {
		title: "report.winWinForPlatform",
		width: 120,
		sorter: (a: RootObject, b: RootObject) => a.platformNetAmount - b.platformNetAmount,
		render: (v: number) => (v ? <p className="text-link">{handleTotalNumber("$", "10k", v)}</p> : "-")
	}
	const dataComparisonReport_platformIncomeAmount = {
		title: "report.platformIncome",
		width: 120,
		sorter: (a: RootObject, b: RootObject) => a.platformIncomeAmount - b.platformIncomeAmount,
		render: (v: number) => (v ? <p className="text-link">{renderColor(v / 10000)}</p> : "-")
	}

	return {
		dataComparisonReport_effecactiveMemberNum,
		dataComparisonReport_activeMemberNum,
		dataComparisonReport_validBetAmount,
		dataComparisonReport_platformNetAmount,
		dataComparisonReport_platformIncomeAmount
	}
}
export default dataComparisonReportColumns
